package com.bw.widget_sdk.bind;

import androidx.databinding.BindingAdapter;

import com.bw.widget_sdk.widget.ShopHeader;
import com.scwang.smart.refresh.footer.ClassicsFooter;
import com.scwang.smart.refresh.header.ClassicsHeader;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener;

public class SmartBind {

    @BindingAdapter(value = {"smartListener"})
    public static void bindSmart(SmartRefreshLayout layout, OnRefreshLoadMoreListener listener){
        layout.setEnableLoadMore(true);
        layout.setEnableRefresh(true);
        layout.setRefreshHeader(new ShopHeader(layout.getContext()));
        layout.setRefreshFooter(new ClassicsFooter(layout.getContext()));
        layout.setOnRefreshLoadMoreListener(listener);
    }

}
